local sk__zhaoxiangc = fk.CreateSkill {

  name = "sk__zhaoxiangc",

  tags = {},

}



sk__zhaoxiangc:addEffect(fk.TargetSpecified, {
  name = "sk__zhaoxiangc",
  anim_type = "control",
  can_trigger = function(self, event, target, player, data)
    return target ~= player and player:hasSkill(sk__zhaoxiangc.name) and data.card and data.card.trueName == "slash" and
    not target.dead
  end,
  on_cost = function(self, event, target, player, data)
    return player.room:askForSkillInvoke(player, sk__zhaoxiangc.name, nil, "#sk__zhaoxiangc-invoke::" .. target.id)
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    room:doIndicate(player.id, { target.id })
    local choices = { "sk__zhaoxiangc2" }
    if not target:isKongcheng() then
      table.insert(choices, 1, "sk__zhaoxiangc1:" .. player.id)
    end
    local choice = room:askForChoice(target, choices, sk__zhaoxiangc.name)
    if choice ~= "sk__zhaoxiangc2" then
      local card = room:askForCardChosen(player, target, "h", sk__zhaoxiangc.name, "#sk__zhaoxiangc-prey::" .. target.id)
      room:moveCardTo(card, Card.PlayerHand, player, fk.ReasonPrey, sk__zhaoxiangc.name, nil, false, player)
    else
      data:cancelTarget(room.alive_players)
      data.nullified = true
    end
    if not player.dead and not player:inMyAttackRange(target) then
      room:askForDiscard(player, 1, 1, false, sk__zhaoxiangc.name, false)
    end
  end,
})

return sk__zhaoxiangc
